package ch.trackedbean.server.data.dom;

import java.util.*;
import ch.trackedbean.validator.defaultValidators.*;

/**
 * Domain object representing an person.
 * 
 * @author hautle
 */
public class PersonDom implements Dom {
	/**
	 * Property constant for {@link #getPicture()}/{@link #setPicture(byte[])}. Type {@link byte[]}.
	 */
	public static final String ATTR_PICTURE = "picture";

	/**
	 * Property constant for {@link #getKey()}/{@link #setKey(int)}. Type {@link int}.
	 */
	public static final String ATTR_KEY = "key";

	/**
	 * Property constant for {@link #getFirstName()}/{@link #setFirstName(String)}. Type {@link String}.
	 */
	public static final String ATTR_FIRST_NAME = "firstName";

	/**
	 * Property constant for {@link #getAddresses()}/{@link #setAddresses(List)}. Type {@link List<AddressDom>}.
	 */
	public static final String ATTR_ADDRESSES = "addresses";

	/**
	 * Property constant for {@link #getName()}/{@link #setName(String)}. Type {@link String}.
	 */
	public static final String ATTR_NAME = "name";

	/** Property constant for {@link #getAge()}/{@link #setAge(int)}. Type {@link String}. */
	public static final String ATTR_AGE = "age";

	private Integer key;

	@Length(min = 3)
	private String name;

	@Length(min = 3)
	private String firstName;

	@Range(min = 0, max = 99)
	private int age;

	@Size(min = 1, max = 3)
	private List<AddressDom> addresses;

	private byte[] picture;

	public PersonDom() {
	}

	/**
	 * @param key
	 * @param name
	 * @param firstName
	 * @param age
	 */
	public PersonDom(Integer key, String name, String firstName, int age) {
		this.key = key;
		this.name = name;
		this.firstName = firstName;
		this.age = age;
	}

	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name The name to set.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return Returns the firstName.
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName The firstName to set.
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return Returns the age.
	 */
	public int getAge() {
		return age;
	}

	/**
	 * @param age The age to set.
	 */
	public void setAge(int age) {
		this.age = age;
	}

	/**
	 * @return Returns the addresses.
	 */
	public List<AddressDom> getAddresses() {
		return addresses;
	}

	/**
	 * @param addresses The addresses to set.
	 */
	public void setAddresses(List<AddressDom> addresses) {
		this.addresses = addresses;
	}

	/**
	 * @return Returns the key.
	 */
	public Integer getKey() {
		return key;
	}

	/**
	 * @param key The key to set.
	 */
	public void setKey(Integer key) {
		this.key = key;
	}

	/**
	 * @return Returns the picture.
	 */
	public byte[] getPicture() {
		return picture;
	}

	/**
	 * @param picture The picture to set.
	 */
	public void setPicture(byte[] picture) {
		this.picture = picture;
	}
}
